.class public Lcom/google/ads/h;
.super Landroid/widget/RelativeLayout;
.source "SourceFile"

# interfaces
.implements Lcom/google/ads/a;


# instance fields
.field private a:Lcom/google/ads/b/r;


# direct methods
.method public constructor <init>(Landroid/app/Activity;Lcom/google/ads/g;Ljava/lang/String;)V
    .locals 3
    .parameter
    .parameter
    .parameter

    .prologue
    const/4 v2, 0x0

    .line 84
    invoke-virtual {p1}, Landroid/app/Activity;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-direct {p0, v0}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;)V

    .line 88
    const/4 v0, 0x0

    :try_start_0
    invoke-direct {p0, p1, p2, v0}, Lcom/google/ads/h;->a(Landroid/content/Context;Lcom/google/ads/g;Landroid/util/AttributeSet;)Z

    .line 89
    const/4 v0, 0x0

    invoke-direct {p0, p1, p2, v0}, Lcom/google/ads/h;->b(Landroid/content/Context;Lcom/google/ads/g;Landroid/util/AttributeSet;)Z

    .line 91
    invoke-direct {p0, p1, p2, p3}, Lcom/google/ads/h;->a(Landroid/app/Activity;Lcom/google/ads/g;Ljava/lang/String;)V
    :try_end_0
    .catch Lcom/google/ads/b/i; {:try_start_0 .. :try_end_0} :catch_0

    .line 97
    :goto_0
    return-void

    .line 92
    :catch_0
    move-exception v0

    .line 93
    const-string v1, "Could not initialize AdView"

    invoke-virtual {v0, v1}, Lcom/google/ads/b/i;->b(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {p0, p1, v1, p2, v2}, Lcom/google/ads/h;->a(Landroid/content/Context;Ljava/lang/String;Lcom/google/ads/g;Landroid/util/AttributeSet;)V

    .line 95
    const-string v1, "Could not initialize AdView"

    invoke-virtual {v0, v1}, Lcom/google/ads/b/i;->a(Ljava/lang/String;)V

    goto :goto_0
.end method

.method private a(Landroid/content/Context;I)I
    .locals 3
    .parameter
    .parameter

    .prologue
    .line 207
    const/4 v0, 0x1

    int-to-float v1, p2

    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    invoke-virtual {v2}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v2

    invoke-static {v0, v1, v2}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F

    move-result v0

    float-to-int v0, v0

    return v0
.end method

.method private a(Landroid/app/Activity;Lcom/google/ads/g;Ljava/lang/String;)V
    .locals 8
    .parameter
    .parameter
    .parameter

    .prologue
    const/4 v6, 0x0

    const/4 v7, -0x2

    .line 534
    new-instance v5, Landroid/widget/FrameLayout;

    invoke-direct {v5, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V

    .line 535
    invoke-virtual {v5, v6}, Landroid/widget/FrameLayout;->setFocusable(Z)V

    .line 538
    new-instance v0, Lcom/google/ads/b/r;

    move-object v1, p0

    move-object v2, p1

    move-object v3, p2

    move-object v4, p3

    invoke-direct/range {v0 .. v6}, Lcom/google/ads/b/r;-><init>(Lcom/google/ads/a;Landroid/app/Activity;Lcom/google/ads/g;Ljava/lang/String;Landroid/view/ViewGroup;Z)V

    iput-object v0, p0, Lcom/google/ads/h;->a:Lcom/google/ads/b/r;

    .line 541
    const/16 v0, 0x11

    invoke-virtual {p0, v0}, Lcom/google/ads/h;->setGravity(I)V

    .line 544
    :try_start_0
    iget-object v0, p0, Lcom/google/ads/h;->a:Lcom/google/ads/b/r;

    invoke-static {p1, v0}, Lcom/google/ads/b/z;->a(Landroid/app/Activity;Lcom/google/ads/b/r;)Landroid/view/ViewGroup;

    move-result-object v0

    .line 545
    if-eqz v0, :cond_0

    .line 546
    const/4 v1, -0x2

    const/4 v2, -0x2

    invoke-virtual {v0, v5, v1, v2}, Landroid/view/ViewGroup;->addView(Landroid/view/View;II)V

    .line 549
    const/4 v1, -0x2

    const/4 v2, -0x2

    invoke-virtual {p0, v0, v1, v2}, Lcom/google/ads/h;->addView(Landroid/view/View;II)V

    .line 563
    :goto_0
    return-void

    .line 553
    :cond_0
    const/4 v0, -0x2

    const/4 v1, -0x2

    invoke-virtual {p0, v5, v0, v1}, Lcom/google/ads/h;->addView(Landroid/view/View;II)V
    :try_end_0
    .catch Ljava/lang/VerifyError; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 557
    :catch_0
    move-exception v0

    .line 558
    const-string v1, "Gestures disabled: Not supported on this version of Android."

    invoke-static {v1, v0}, Lcom/google/ads/util/d;->a(Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 559
    invoke-virtual {p0, v5, v7, v7}, Lcom/google/ads/h;->addView(Landroid/view/View;II)V

    goto :goto_0
.end method

.method private a(Landroid/content/Context;Ljava/lang/String;Lcom/google/ads/g;Landroid/util/AttributeSet;)V
    .locals 6
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 294
    invoke-static {p2}, Lcom/google/ads/util/d;->b(Ljava/lang/String;)V

    .line 297
    const/high16 v3, -0x1

    move-object v0, p0

    move-object v1, p1

    move-object v2, p2

    move-object v4, p3

    move-object v5, p4

    invoke-virtual/range {v0 .. v5}, Lcom/google/ads/h;->a(Landroid/content/Context;Ljava/lang/String;ILcom/google/ads/g;Landroid/util/AttributeSet;)V

    .line 298
    return-void
.end method

.method private varargs a([Lcom/google/ads/g;)V
    .locals 4
    .parameter

    .prologue
    .line 657
    array-length v0, p1

    new-array v1, v0, [Lcom/google/ads/g;

    .line 658
    const/4 v0, 0x0

    :goto_0
    array-length v2, p1

    if-ge v0, v2, :cond_0

    .line 659
    aget-object v2, p1, v0

    invoke-virtual {p0}, Lcom/google/ads/h;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-static {v2, v3}, Lcom/google/ads/g;->a(Lcom/google/ads/g;Landroid/content/Context;)Lcom/google/ads/g;

    move-result-object v2

    aput-object v2, v1, v0

    .line 658
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 661
    :cond_0
    iget-object v0, p0, Lcom/google/ads/h;->a:Lcom/google/ads/b/r;

    invoke-virtual {v0}, Lcom/google/ads/b/r;->g()Lcom/google/ads/as;

    move-result-object v0

    iget-object v0, v0, Lcom/google/ads/as;->l:Lcom/google/ads/util/ad;

    invoke-virtual {v0, v1}, Lcom/google/ads/util/ad;->a(Ljava/lang/Object;)V

    .line 662
    return-void
.end method

.method private a(Landroid/content/Context;Lcom/google/ads/g;Landroid/util/AttributeSet;)Z
    .locals 1
    .parameter
    .parameter
    .parameter

    .prologue
    .line 226
    invoke-static {p1}, Lcom/google/ads/util/AdUtil;->c(Landroid/content/Context;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 227
    const-string v0, "You must have AdActivity declared in AndroidManifest.xml with configChanges."

    invoke-direct {p0, p1, v0, p2, p3}, Lcom/google/ads/h;->a(Landroid/content/Context;Ljava/lang/String;Lcom/google/ads/g;Landroid/util/AttributeSet;)V

    .line 232
    const/4 v0, 0x0

    .line 235
    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x1

    goto :goto_0
.end method

.method private b(Landroid/content/Context;Lcom/google/ads/g;Landroid/util/AttributeSet;)Z
    .locals 1
    .parameter
    .parameter
    .parameter

    .prologue
    .line 255
    invoke-static {p1}, Lcom/google/ads/util/AdUtil;->b(Landroid/content/Context;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 256
    const-string v0, "You must have INTERNET and ACCESS_NETWORK_STATE permissions in AndroidManifest.xml."

    invoke-direct {p0, p1, v0, p2, p3}, Lcom/google/ads/h;->a(Landroid/content/Context;Ljava/lang/String;Lcom/google/ads/g;Landroid/util/AttributeSet;)V

    .line 261
    const/4 v0, 0x0

    .line 264
    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x1

    goto :goto_0
.end method


# virtual methods
.method a(Landroid/content/Context;Ljava/lang/String;ILcom/google/ads/g;Landroid/util/AttributeSet;)V
    .locals 7
    .parameter
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    const/16 v4, 0x11

    .line 162
    if-nez p4, :cond_0

    .line 163
    sget-object p4, Lcom/google/ads/g;->b:Lcom/google/ads/g;

    .line 166
    :cond_0
    invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {p4, v0}, Lcom/google/ads/g;->a(Lcom/google/ads/g;Landroid/content/Context;)Lcom/google/ads/g;

    move-result-object v3

    .line 168
    invoke-virtual {p0}, Lcom/google/ads/h;->getChildCount()I

    move-result v0

    if-nez v0, :cond_1

    .line 170
    if-nez p5, :cond_2

    new-instance v0, Landroid/widget/TextView;

    invoke-direct {v0, p1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    .line 172
    :goto_0
    invoke-virtual {v0, v4}, Landroid/widget/TextView;->setGravity(I)V

    .line 173
    invoke-virtual {v0, p2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 174
    invoke-virtual {v0, p3}, Landroid/widget/TextView;->setTextColor(I)V

    .line 175
    const/high16 v1, -0x100

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setBackgroundColor(I)V

    .line 178
    if-nez p5, :cond_3

    new-instance v1, Landroid/widget/LinearLayout;

    invoke-direct {v1, p1}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    .line 180
    :goto_1
    invoke-virtual {v1, v4}, Landroid/widget/LinearLayout;->setGravity(I)V

    .line 183
    if-nez p5, :cond_4

    new-instance v2, Landroid/widget/LinearLayout;

    invoke-direct {v2, p1}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    .line 185
    :goto_2
    invoke-virtual {v2, v4}, Landroid/widget/LinearLayout;->setGravity(I)V

    .line 186
    invoke-virtual {v2, p3}, Landroid/widget/LinearLayout;->setBackgroundColor(I)V

    .line 189
    invoke-virtual {v3}, Lcom/google/ads/g;->a()I

    move-result v4

    invoke-direct {p0, p1, v4}, Lcom/google/ads/h;->a(Landroid/content/Context;I)I

    move-result v4

    .line 190
    invoke-virtual {v3}, Lcom/google/ads/g;->b()I

    move-result v3

    invoke-direct {p0, p1, v3}, Lcom/google/ads/h;->a(Landroid/content/Context;I)I

    move-result v3

    .line 193
    add-int/lit8 v5, v4, -0x2

    add-int/lit8 v6, v3, -0x2

    invoke-virtual {v1, v0, v5, v6}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;II)V

    .line 194
    invoke-virtual {v2, v1}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;)V

    .line 195
    invoke-virtual {p0, v2, v4, v3}, Lcom/google/ads/h;->addView(Landroid/view/View;II)V

    .line 197
    :cond_1
    return-void

    .line 170
    :cond_2
    new-instance v0, Landroid/widget/TextView;

    invoke-direct {v0, p1, p5}, Landroid/widget/TextView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    goto :goto_0

    .line 178
    :cond_3
    new-instance v1, Landroid/widget/LinearLayout;

    invoke-direct {v1, p1, p5}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    goto :goto_1

    .line 183
    :cond_4
    new-instance v2, Landroid/widget/LinearLayout;

    invoke-direct {v2, p1, p5}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    goto :goto_2
.end method

.method public a(Lcom/google/ads/d;)V
    .locals 1
    .parameter

    .prologue
    .line 605
    iget-object v0, p0, Lcom/google/ads/h;->a:Lcom/google/ads/b/r;

    if-eqz v0, :cond_1

    .line 607
    invoke-virtual {p0}, Lcom/google/ads/h;->a()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 608
    iget-object v0, p0, Lcom/google/ads/h;->a:Lcom/google/ads/b/r;

    invoke-virtual {v0}, Lcom/google/ads/b/r;->d()V

    .line 611
    :cond_0
    iget-object v0, p0, Lcom/google/ads/h;->a:Lcom/google/ads/b/r;

    invoke-virtual {v0, p1}, Lcom/google/ads/b/r;->a(Lcom/google/ads/d;)V

    .line 613
    :cond_1
    return-void
.end method

.method public a()Z
    .locals 1

    .prologue
    .line 589
    iget-object v0, p0, Lcom/google/ads/h;->a:Lcom/google/ads/b/r;

    if-nez v0, :cond_0

    .line 590
    const/4 v0, 0x0

    .line 593
    :goto_0
    return v0

    :cond_0
    iget-object v0, p0, Lcom/google/ads/h;->a:Lcom/google/ads/b/r;

    invoke-virtual {v0}, Lcom/google/ads/b/r;->q()Z

    move-result v0

    goto :goto_0
.end method

.method protected onMeasure(II)V
    .locals 2
    .parameter
    .parameter

    .prologue
    .line 670
    iget-object v0, p0, Lcom/google/ads/h;->a:Lcom/google/ads/b/r;

    invoke-virtual {v0}, Lcom/google/ads/b/r;->j()Lcom/google/ads/b/c;

    move-result-object v0

    .line 671
    if-eqz v0, :cond_0

    .line 672
    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/google/ads/b/c;->setVisibility(I)V

    .line 674
    :cond_0
    invoke-super {p0, p1, p2}, Landroid/widget/RelativeLayout;->onMeasure(II)V

    .line 675
    return-void
.end method

.method public setAdListener(Lcom/google/ads/c;)V
    .locals 1
    .parameter

    .prologue
    .line 624
    iget-object v0, p0, Lcom/google/ads/h;->a:Lcom/google/ads/b/r;

    invoke-virtual {v0}, Lcom/google/ads/b/r;->g()Lcom/google/ads/as;

    move-result-object v0

    iget-object v0, v0, Lcom/google/ads/as;->m:Lcom/google/ads/util/ad;

    invoke-virtual {v0, p1}, Lcom/google/ads/util/ad;->a(Ljava/lang/Object;)V

    .line 625
    return-void
.end method

.method protected setAppEventListener(Lcom/google/ads/i;)V
    .locals 1
    .parameter

    .prologue
    .line 633
    iget-object v0, p0, Lcom/google/ads/h;->a:Lcom/google/ads/b/r;

    invoke-virtual {v0}, Lcom/google/ads/b/r;->g()Lcom/google/ads/as;

    move-result-object v0

    iget-object v0, v0, Lcom/google/ads/as;->n:Lcom/google/ads/util/ad;

    invoke-virtual {v0, p1}, Lcom/google/ads/util/ad;->a(Ljava/lang/Object;)V

    .line 634
    return-void
.end method

.method protected varargs setSupportedAdSizes([Lcom/google/ads/g;)V
    .locals 1
    .parameter

    .prologue
    .line 642
    iget-object v0, p0, Lcom/google/ads/h;->a:Lcom/google/ads/b/r;

    invoke-virtual {v0}, Lcom/google/ads/b/r;->g()Lcom/google/ads/as;

    move-result-object v0

    iget-object v0, v0, Lcom/google/ads/as;->l:Lcom/google/ads/util/ad;

    invoke-virtual {v0}, Lcom/google/ads/util/ad;->a()Ljava/lang/Object;

    move-result-object v0

    if-nez v0, :cond_0

    .line 643
    const-string v0, "Error: Tried to set supported ad sizes on a single-size AdView."

    invoke-static {v0}, Lcom/google/ads/util/d;->b(Ljava/lang/String;)V

    .line 648
    :goto_0
    return-void

    .line 647
    :cond_0
    invoke-direct {p0, p1}, Lcom/google/ads/h;->a([Lcom/google/ads/g;)V

    goto :goto_0
.end method
